home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6835 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  46 lines

  1. Newsgroups: boeing.comp.unix,comp.lang.c,comp.lang.c++,comp.sources.wanted
  2. Path: in1.uu.net!bcstec!roloff
  3. From: roloff@bcstec.ca.boeing.com (Craig Roloff)
  4. Subject: Re: regular expression matching source code
  5. Message-ID: <Dn18y8.JA5@bcstec.ca.boeing.com>
  6. Organization: The Boeing Company
  7. References: <DMwHzn.LIF@bcstec.ca.boeing.com>
  8. Distribution: na
  9. Date: Mon, 19 Feb 1996 17:08:31 GMT
  10.  
  11. In article <DMwHzn.LIF@bcstec.ca.boeing.com>,
  12. Todd Waetzig <waetzig@bcstec.ca.boeing.com> wrote:
  13. >I am looking for the 'C' or 'C++' source for a function to
  14. >perform a match of a string. This function would
  15. >use the syntax of regular expressions. This regular
  16. >expression matching would be similar to that used by
  17. >grep and sed.
  18. >
  19. >Ideally it would look something like
  20. >
  21. >if (match("^1([A-Z]*|[0-9]*)Z?",string_to_search) == 0)
  22. >    printf("match found ");
  23. >
  24. >this would match a string_to_search if it
  25. >    began with a digit 1
  26. >        followed by any number of occurences of uppercase letters
  27. >    or by any number of occurrences of digits
  28. >    followed by zero or one occurrence of the letter Z
  29. >
  30. >Thanks,
  31. >
  32. >-- 
  33. >Todd Waetzig                Programmer/Analyst     Boeing Computer Services
  34. >                                                   waetzig@bcstec.ca.boeing.com
  35.  
  36. If you have access to a SysV UNIX machine, do a man on regexp.
  37. These are a set of regular expression matching routines.  On
  38. all the machines I've seen, the actual code is in the include
  39. file itself, typically /usr/include/regexp.h.  Let me know if
  40. you don't have access and I can e-mail the file.
  41. -- 
  42.    _____         Craig A Roloff
  43.  /_[__T__\___    roloff@bcstec.boeing.com
  44. { CAR |- |    )  206.237.7660
  45.  `(_)----(_)-'   (usual disclaimers apply)
  46.